﻿@model IEnumerable<ApplicationUser>

@{
    ViewData["Title"] = "User List";
}

<h2>@ViewData["Title"]</h2>

<table class="table">
    <thead>
        <tr>
            <th>Username</th>
            <th>Is Admin</th>
            <th>Actions</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var user in Model)
        {
            <tr>
                <td>@user.UserName</td>
                <td>@(user.IsAdmin ? "Yes" : "No")</td>
                <td>
                    <a asp-action="Edit" asp-route-id="@user.Id" class="btn btn-sm btn-primary">Edit</a>
                </td>
            </tr>
        }
    </tbody>
</table>

<div>
    <a asp-action="Register" class="btn btn-success">Create New User</a>
</div>